<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title><spring:message code="warehouse_shelves" /></title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
    <script src="${ctxStatic}/jquery-barcode/jquery-barcode.js" type="text/javascript"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script type="text/javascript">       
    
    
    //生成条形码 
    /* $(document).ready(function(){
        $("#materialBarCodeDiv").empty().barcode($("#materialBarCode").val(), "code128",{barWidth:2, barHeight:30,showHRI:false});
       });  */
       
    //检索 
    function searchListForm() {
    	var params = $("#searchForm").serialize();
    	$("#activity_pane").showLoading();
		$.post("${ctx}/warehouse/message/searchList",params, function(result) {
			var listHtml = result["warehouse"];
			var pageHtml = result["page"];
			$("#listHtml").html(listHtml);
			$("#paging").html(pageHtml);
			$("#activity_pane").hideLoading();
		}, 'json');
	}
       	   
       
	//重置
	function clean() {
		$("input").val("");
		$("select").val("");
		$("#searchForm").submit();
	}
    </script>        
</head>
<body >
<div class="listArea" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
        <form id="searchForm" name="searchForm" method="post">
       	 	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
            <div class="searchLeft clearfix">
                <div class="searchInp clearfix">
                    <p><spring:message code="warehouse_code" /></p>
                    <input id="warehouseCode" name="warehouseCode" value=""  maxlength="50">
            	</div>
            	<div class="searchInp clearfix">
                    <p><spring:message code="warehouse_name" /></p>
                    <input id="warehouseName" name="warehouseName" value="" maxlength="50">
            	</div>
            	<div class="searchInp clearfix">
            	<c:set value="WAREHOUSE_CATEGORY" var="warehouseCategory" />
                    <p><spring:message code="warehouse_type" /></p>
                    <select id="warehouseType" name="warehouseType" style="width: 120px">
                    <option value=""><spring:message code="warehouse_pleaseSelect" /></option>
                    <c:forEach items="${fns:getDictList(warehouseCategory)}" var="warehouse">
                        <option  value="${warehouse.itemCode}-${warehouse.itemValue}" >${warehouse.itemName}</option>
                    </c:forEach>
                    </select>
            	</div>
            </div>   
            <div class="searchRight clearfix">
            	<!-- 检索 -->
            	<shiro:hasPermission name="warehouse:message:view">
                <button type="button" class="btn-js" onclick="searchListForm();">
						<spring:message code="commom_check" />
				</button>
				</shiro:hasPermission>
				<!-- 重置 -->
				<shiro:hasPermission name="warehouse:message:view">
                <button type="button" class="btn-js" onclick="clean();">
						<spring:message code="common_reset" />
				</button>
				</shiro:hasPermission>
				<!-- 创建  -->
                <button type="button" onclick="popup('800px','519px','${ctx}/warehouse/message/createWarehouse?editFlag=1')">
                		<spring:message code="common_create" />
                </button>
            
            </div>
          </form>
        </div>
   
        <div class="tableArea">
				<div class="tableScrollSm" style="overflow: auto;width: 1293px;height: 714px; ">
                <table cellpadding="0" class="tableHead">
                    <thead>
                    <tr>
                    	<th><p class="table-No"><spring:message code="common_no" /></p></th>
                        <th><p class="table-ckdm"><spring:message code="warehouse_code" /></p></th>
                        <th><p class="table-ckmc"><spring:message code="warehouse_name" /></p></th>
                        <th><p class="table-cklb"><spring:message code="warehouse_type" /></p></th>
                        <th><p class="table-ckwz"><spring:message code="warehouse_place" /></p></th>
                        <th><p class="table-ckbz"><spring:message code="warehouse_remark" /></p></th>
                        <th><p class="table-ckzt"><spring:message code="warehouse_status" /></p></th>
                        <th><p class="table-ckcjr"><spring:message code="warehouse_creator" /></p></th>
                        <th><p class="table-ckcjrq"><spring:message code="warehouse_createTime" /></p></th>
                        
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody">
                    <tbody id = "listHtml">
                    
                    </tbody>
                </table>
            </div>
        </div>
    </div>
     <div id = "paging" ></div>
</div>
   
<script type="text/javascript">
$(document).ready(function(){
	searchListForm();
	
	$("#warehouseType").select2();
});
</script>
</body>
</html>
